The Invoke Service action calls a specified service, typically another controller, and updates the FactBase with the response XML.
The Service field should contain the full ID of the controller to call, and the Action field should specify the action to call on that controller.
The Service Call Helper option can be used to find the required agent ID. This should open a new window, providing drop down lists of available controllers. When you have selected the required entry, click the OK button to populate the values required for the action.
Ff you wish to call an external web service, you should create a controller to act as a proxy to that service. You can then specify an Invoke Service rule to call the proxy controller. Then, during deployment, you can designate the proxy controller as a web service proxy and enter the relevant location information of the remote service. By using this approach, you avoid the need to enter external location information within your application logic.
The Invoke Service action has two parameters. The first (from location) indicates the xml node to send as the request to the service, and the second parameter (to location) indicates the location in the FactBase to insert the response. Both of these require XPaths.
The Invoke Service action also supports the Merge Option setting to determine how the returned XML will be inserted.
Parallel Processing
The Invoke Service action also has the ability to perform a non-blocking service call. This starts the service call on a different thread, enabling the rest of this rule, and other rules to continue execution. Once all the rules have been processed, this controller will wait for any parallel calls to also complete, before returning a response.
If you need to perform some functionality when the response from a parallel call has been retrieved, you should add an additional rule that has a condition check looking for this response structure in the FactBase. We recommend enabling Forward Chaining to ensure this functions correctly.
This parallel capability is often useful when you are making multiple calls to third party services. For example, if you are calling two independent web services from a single controller, you could run these both in parallel, and potentially reduce the overall execution time for the controller.
To activate this feature simply click the Run this Action in Parallel? tick box.